define(function(require,exports,module){
	/**--tmpl-require--**/

	//加载依赖
	require("ajaxproxy");
	require("JTemplate");
	require("layer");
	var jArea = require("areaselect");

	var common = require("common");

	//初始化AjaxProxy插件
	$('.ajaxproxy').AjaxProxy({
		dataType : "json",
		method : "post",
		formId : "content-add-form",
		formCheckHandler : function(form_id) {
			//getDeliveryPlace();
			return common.formCheckHandler(form_id, true);
		},
		callbackDelay : __global.jdialog.timer,
		timeInterval : __global.jdialog.timer,
		callBack : function (data) {   /* 执行ajax之后的回调函数 */
			common.ajaxCallback(data);
		}
	});

	exports.init=function(){

		$(".area-wrap").JAreaSelect(exports.area);
	};
	exports.initByEdit=function(){
		console.log(exports.area);
		$(".area-wrap").JAreaSelect(exports.area);
/*
		if(exports.address!=''){

			setDeliveryPlace(exports.address);
		}*/

	};
});


//获取交收地
function getDeliveryPlace(){
	var s_province=$("select[name='data[s_province]']").val();
	var s_city=$("select[name='data[s_city]']").val();
	var s_county=$("select[name='data[s_county]']").val();

}
//获取交收地
function setDeliveryPlace(address){

	var prlace_obj=jQuery.parseJSON(address);
	var s_province=prlace_obj.prov;
	var s_city=prlace_obj.city;
	var s_county=prlace_obj.county;
	/*
	$("#city").citySelect({
		url:"../../product/area/output",
		prov: s_province,
		city: s_city,
		dist: s_county,
		nodata: "none",
		required:false

	});*/


}

